/*
* Copyright (c) Huawei Technologies Co., Ltd. 2017-2019. All rights reserved.
* Description: demuser for ts
* Author: HiMobileCam middleware develop team
* Create: 2017-12-22
*/

#ifndef TS_FORMAT_H
#define TS_FORMAT_H

#include "hi_type.h"
#include "hi_defs.h"
#include "ffdemux_common.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */

typedef struct {
    HI_U32 sync; /* syncword */
    HI_U32 sampleRate;
    HI_U32 channelNum;
    HI_U32 frameLength;
} AacMediaInfo;

HI_S32 TsSetAudioInfo(FfDemuxFormatMember *tsDemuxer, HI_FORMAT_PACKET_S *fmtFrame);
HI_S32 TsSetVideoInfo(FfDemuxFormatMember *tsDemuxer, HI_FORMAT_PACKET_S *fmtFrame);
HI_S32 TsProbeAudio(FfDemuxFormatMember *tsDemuxer);
HI_S32 TsSeekMS(FfDemuxFormatMember *tsDemuxer, HI_S64 toMs,
    __attribute__((unused)) HI_S32 flag);

HI_S32 TsReadUntilIframe(FfDemuxFormatMember *tsDemuxer);

HI_S32 TsProbeByParseFrame(FfDemuxFormatMember *tsDemuxer);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */

#endif /* TS_FORMAT_H */
